home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / visual / perl.exe / {app} / Webroot / cgi-bin / internal_links.cgi < prev    next >
Encoding:
Text File  |  2003-01-11  |  1.0 KB  |  36 lines

  1. #!perl
  2.  
  3. use CGI;
  4.  
  5. $query = new CGI;
  6.  
  7. # We generate a regular HTML file containing a very long list
  8. # and a popup menu that does nothing except to show that we
  9. # don't lose the state information.
  10.  
  11. print $query->header;
  12. print $query->start_html("Internal Links Example");
  13. print "<H1>Internal Links Example</H1>\n";
  14. print "Click <cite>Submit Query</cite> to create a state.  Then scroll down and",
  15.     " click on any of the <cite>Jump to top</cite> links.  This is not very exciting.";
  16.  
  17. print "<A NAME=\"start\"></A>\n"; # an anchor point at the top
  18.  
  19. # pick a default starting value;
  20. $query->param('amenu','FOO1') unless $query->param('amenu');
  21.  
  22. print $query->startform;
  23. print $query->popup_menu('amenu',[('FOO1'..'FOO9')]);
  24. print $query->submit,$query->endform;
  25.  
  26. # We create a long boring list for the purposes of illustration.
  27. $myself = $query->self_url;
  28. print "<OL>\n";
  29. for (1..100) {
  30.     print qq{<LI>List item #$_ <A HREF="$myself#start">Jump to top</A>\n};
  31. }
  32. print "</OL>\n";
  33.  
  34. print $query->end_html;
  35.  
  36.